# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: yk <yk at archlinuxcn dot org>

pkgname=libqtshadowsocks
pkgver=2.1.0
pkgrel=15
pkgdesc="A lightweight library for shadowsocks"
arch=("loong64" "x86_64")
url="https://github.com/shadowsocks/libQtShadowsocks"
license=("GPL")
depends=('botan2' 'qt5-base')
makedepends=('cmake')
source=("$pkgname-$pkgver.tar.gz::https://github.com/shadowsocks/libQtShadowsocks/archive/v$pkgver.tar.gz"
        libqtshadowsocks-botan-2.11.patch)
sha512sums=('af5b71ce7e40b593bf95c1000d866e2c4426d17398620083a996b84234524e8418fbae071edd03ac1944817a96d7eee8b0b7a5860872fef41996ebbda8418558'
            'ba825507fb714a350e2eeafaad0435f901efb8c65ae8c5bbbba6839c028d698dafc6d665c5c648ded6bbe666a5e35f1721a0ec214df7648e98bd2b5d7076d24f')

prepare() {
  cd libQtShadowsocks-$pkgver
  patch -p1 -i ../libqtshadowsocks-botan-2.11.patch # Fix build with botan 2.11
}

build() {
  cd libQtShadowsocks-$pkgver
  cmake -DCMAKE_INSTALL_PREFIX=/usr .
  make
}

package() {
  cd libQtShadowsocks-$pkgver
  make DESTDIR="$pkgdir" install
}
